<template>
  <div>
    home 组件



  </div>

  <div>

    {{ counterStore.count }}----{{ counterStore.msg }};

    计算属性:{{ counterStore.doubleCount }}
  </div>

  <button @click="handlerCount"> 点击 count++</button>
</template>

<script setup>

// 1 引入 
import { useCounterStore } from '../../store/counter'
// 2  调用   
const counterStore = useCounterStore()

console.log(counterStore) //  

console.log(counterStore.count) //  不需要加 state 
console.log(counterStore.msg)  // 直接获取 不需要加 state


const handlerCount = () => {
  counterStore.add1()  //  直接调用
}


</script>

<style lang="scss" scoped></style>